package cn.ym.mall.dao;

import cn.ym.mall.entity.Staff;
import java.sql.SQLException;
import java.util.List;

public interface StaffDao {
    /**
     * 分页查询所有员工(不显示密码字段)
     * @param pageNo
     * @param pageSize
     * @return
     * @throws SQLException
     */
    public List<Staff> getAll(Integer pageNo, Integer pageSize) throws SQLException;

    /**
     * 添加员工
     * @param staff
     * @return
     * @throws SQLException
     */
    public int add(Staff staff) throws SQLException;

    /**
     * 根据员工编号删除员工
     * @param stid
     * @return
     * @throws SQLException
     */
    public int delete(Integer stid) throws SQLException;

    /**
     * 更新员工信息
     * @param staff
     * @return
     * @throws SQLException
     */
    public int update(Staff staff) throws SQLException;

    /**
     * 获得总员工数
     * @return
     * @throws SQLException
     */
    public long getCount() throws SQLException;

    /**
     * 根据员工编号找员工
     * @param stid
     * @return
     * @throws SQLException
     */
    public Staff getStaffByStid(Integer stid) throws SQLException;

    /**
     * 根据员工姓名找员工
     * @param stname
     * @return
     * @throws SQLException
     */
    public Staff getStaffByStname(String stname) throws SQLException;

    /**
     * 根据角色id查询员工
     * @param rid
     * @return
     * @throws SQLException
     */
    public List<Staff> getStaffByRid(Integer rid,Integer PageNo,Integer PageSize) throws SQLException;

    /**
     * 账号查询员工(可用于员工登录判断)
     * @param staccount
     * @return
     * @throws SQLException
     */
    public Staff getStaffByStaccount(String staccount) throws SQLException;

}
